Copyright: Windows Help Designer


Audio unit

The Audio unit contains the objects for recording, playback Wave audio data.

Objects

 TWaveIn

 TWaveOut


TWaveIn component

 Properties  Methods  Events

Unit

  AUDIO

Description

 TWaveIn component a  Wave audio capture component.

 Use the open method to open the Wave input device and start recording.

 Use the close method to close the device and stop recording.

 The wave audio binary data are captured thru the  OnWaveInData event.


TWaveOut component

 properties  methods events

Unit

   AUDIO

Description

  Use TWaveOut component for playback wave audio data capture with previous

  TWaveIn component. Use the Open method to open the Wave out device.

  Use playback method for playing data and finally use the he Close method to close the device


Sample                  Recording

 Stereo                    DeviceID

 WaveBufSize      Handle


Open

 Close


OnWaveInData

 OnWaveInOpen

 OnWaveInClose

BeforeOpen


Open method

Applies to

  TWaveIn

Declaration

 procedure Open; virtual;

Description

 The open method open the wave input device and starts recording wave audio.


Close method

Applies to

  TWaveIn

Declaration

 procedure Close;

Description

 The close mehtod close the wave input device and stops recording wave audio data.


Sample property

Applies to

  TWaveIn,  TWaveOut

Declaration

 property Samples : Integer;

Description

 The Sample property specifies  the Sample rate, in samples per second (hertz),

 that each channel should be played or recorded.

 If audio wave format is WAVE_FORMAT_PCM, then common values for

 Samples are 8.0 kHz, 11.025 kHz, 22.05 kHz, and 44.1 kHz.

 For non-PCM formats, this member must be computed according to the manufacturer's

 specification of the format tag.


Stereo property

Applies to

  TWaveIn,  TWaveOut

Declaration

  property Stereo : Boolean;

Description

  The stereo property specifies if the wave audio device are recording or playback stereo data.


Recording property

Applies to

   TWaveIn

Declaration

  property Recording : Boolean;

Description

 The recording property gives you back the status of the wave input device.

 If you are currently recording audio then returns True otherwise False.

 When assigning a True value to recording property is the same as calling the  Open method


DeviceID property

Applies to

  TWaveIn,  TWaveOut

Declaration

  property DeviceID : Integer;

Description

 The DeviceID property specifies which input or output device the TWaveIn or TWaveOut components

 are going to open for recording, playback.

 By default TWaveIn and TWaveOut are using the default devices assigned

 to windows environement (WAVE_MAPPER)


Handle property

Applies to

  TWaveIn,  TWaveOut

Declaration

  property Handle : integer; ( Read-Only )

Description

 The handle property is a read only property and its identifying the open waveform-audio input or output device.

  Use this handle to identify the device when calling other waveform-audio input or output functions.


WaveBufSize property

Applies to

   TWaveIn

Declaration

 property   WaveBufSize : Integer;

Description

  The WaveBufSize property specifies the buffer that TWaveIn component will allocate

  storing wave audio recorded data.


Sample                 Handle

 Stereo                   DeviceID


Open              Close

 Playback


OnWaveInData Event

Applies to

   TWaveIn

Declaration

   TWaveInData = procedure (Data : PChar; Size : integer) of object;;

  property OnWaveInData : TWaveInData;

Description

 The OnWaveInData occurs when the TWaveIn components has filled the internal buffers with

 wave form audio binary data.


OnWaveInOpen property

Applies to

  TWaveIn

Declaration

  property   OnWaveInOpen : TNotifyEvent;

Description

 The OnWaveInOpen event occurs after the TWaveIn component has opened the wave input device.


OnWaveClose event

Applies to

   TWaveIn

Declaration

   property    OnWaveInClose  : TNotifyEvent;

Description

 The OnWaveInClose event occurs after the TWaveIn component has closed the device


BeforeOpen event

Applies to

   TWaveIn,  TWaveOut

Declaration

    TBeforeOpen = procedure (var WaveFormat : pointer) of object;

   property BeforeOpen : TBeforeOpen;

Description

  The BeforeOpen property occurs before the TWaveIn ot TWaveOut components  open the devices.

  You may use this Event with care the WAVEFORM variable points to a TWAVEFORMEX structure (see Windows Help) .

  In this events you may change the default characteristics for opening the wave devices.

 Check the GSMAudio.PAS source its demonstrates the use of BeforeOpen event openning the devices

 with audio compession.


Open method

Applies to

   TWaveOut

Declaration

 procedure Open; virtual;

Description

 Use the open method for oppening the wave out device.


Close method

Applies to

   TWaveOut

Declaration

 procedure Close;

Description

 Use the close method for closing the wave out device.


Playback method

Applies to

   TWaveOut

Declaration

     procedure   PlayBack(Data : PChar; Size : integer);

Description

   Playback method is used for playback wave audio data allready captured.

  The data buffer specifies the binary data and size the buffer size.